<?php
/**
 * Created by PhpStorm.
 * User: 于婧雯
 * Date: 2019/3/19
 * Time: 10:02
 */
namespace App\Http\Controllers\NewAdmin;

use App\Http\Controllers\AdapterWebController;
use Illuminate\Http\Request;
use App\Modules\Wallet\Withdraw as ApiWithdraw;

//后台提现管理
class Withdraw extends AdapterWebController
{
    // 申请提现列表
    public function adminWithdrawList(Request $request)
    {
        if (empty($request['keywords'])) {
            $postData['keywords'] = '';
        } else {
            $postData['keywords'] = $request['keywords'];
        }
        $list = $this->appLayerExec(ApiWithdraw::class, 'adminWithdrawList', $postData);
        return view('newAdmin.withdraw.withdraw_list', ['list' => $list['res']]);
    }

    // 审核提现
    public function auditWithdraw($id,$status)
    {
        $postData['id'] = (int)$id;
        $postData['status'] = (int)$status;
        $res = $this->appLayerExec(ApiWithdraw::class, 'auditWithdraw', $postData);
        if ($res['code'] == 200) {
            return ['status' => 0, 'msg' => '操作完成!'];
        }
        return ['status' => -1, 'msg' => '操作异常，请重试!'];
    }

}
